<%@page contentType="text/html;charset=utf-8" %>
<%@taglib prefix="s" uri="/struts-tags" %>   
<script type="text/javascript">

function cl_checkreleased(obj)
{
	var name = document.getElementById("client.name").value;
    var channelid = dijit.byId("client.channelId").get("value");
    var projectid = dijit.byId("client.projectId").get("value");
    var url = "cl/version/checkclient.do";
    var content = "client.name=" + name 
                + "&client.projectId=" + projectid
                + "&client.channelId=" + channelid;
    var objectid = "cl_checkclient";
    sendXMLHttpRequest(url, content, objectid); 
}

function pi_savereleased(type)
{
    if (document.getElementById("hasActionErrors"))
    {
        alert("选择错误！");
        return false;
    }
    var version = document.getElementById("released.version").value;
    if (/*rl_id == null || rl_id == "" 
        || */version == null || version == ""/*
        || rl_value == null || rl_value == ""*/)
    {
        alert("信息不完整！");
        return false;
    }

    if (!confirm("确定继续？"))
    {
        return false;
    }
    var url = "pi/release/save.do?type=" + type;
    /*alert(content);*/
    var objectid = "pi_released";
    postXMLHttpRequest(url, "myform", objectid); 
}
</script>
 <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="5"></td>
    <td>   
  <form id="myform" name="myform" id="myform" enctype="multipart/form-data" 
        method="post" action="">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td colspan="3">
        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><img src="images/table_top_left.jpg" width="20" height="15" /></td>
            <td><img src="images/table_top_bg.jpg" width="770" height="15"/></td>
            <td align="right">
              <img src="images/table_top_right.jpg" width="20" height="15" /></td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td height="25" colspan="3" class="table_blue">
        <strong><img src="images/dot.jpg" width="13" height="9">版本信息</strong></td>
    </tr> 
    <tr>
      <td class="table_w1" align="center" width="20%">&nbsp;<font color="red">(*)</font>版本：</td>
      <td class="table_w2" colspan="2">&nbsp;
        <input type="hidden" id="released.id" name="released.id" value="<s:property value="released.id"/>" />
        <input type="hidden" id="released.plugin" name="released.plugin" value="<s:property value="released.plugin"/>" />
        <input id="released.version" name="released.version" type="text" size="60" 
          value="<s:property value="released.version" />" /></td>
    </tr>  
    <tr>
      <td class="table_w1" align="center" width="20%">&nbsp;文件：</td>
      <td class="table_w2" colspan="2">&nbsp;
        <input type="file" id="pluginfile" name="pluginfile" size="60" /></td>
    </tr>  
    <tr>
      <td class="table_w1" align="center" width="20%">&nbsp;<font color="red">(*)</font>开发者：</td>
      <td class="table_w2" colspan="2">&nbsp;
        <input id="released.developer" name="released.developer" type="text" size="60" value="<s:property value="released.developer"/>" /></td>
    </tr>
    <tr>
      <td class="table_w1" align="center" width="20%">&nbsp;<font color="red">(*)</font>版本说明：</td>
      <td class="table_w2" colspan="2">&nbsp;
        <textarea id="released.notes" name="released.notes" cols="60" rows="3"><s:property value="released.notes"/></textarea></td>
    </tr>
    <tr>
      <td colspan="3" class="table_w1" align="center">
        <s:if test="type.equals('insert')" >
        <button id="btn2" dojoType="dijit.form.Button"
            onclick="pi_savereleased('insert');">添加</button>
        </s:if>
        <s:else>
        <button id="btn2" dojoType="dijit.form.Button"
            onclick="pi_savereleased('update');">修改</button>
        &nbsp;&nbsp;        
        <button id="btn3" dojoType="dijit.form.Button"
            onclick="pi_savereleased('delete');">删除</button>
        </s:else>
      </td>      
    </tr>
    <tr> 
      <td colspan="3" background="images/table_bom_bg.jpg">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="images/table_bom_left.jpg" width="20" height="15"></td>
          <td></td>
          <td align="right">
            <img src="images/table_bom_right.jpg" width="20" height="15"></td>
        </tr>
        </table>
      </td>
    </tr>
  </table>  
  </form>
  </td>
  <td width="5"></td>
  </tr>
  </table>